package cn.edu.shou.lab.homework.work1.jcc.commonClass;

import java.io.Serializable;
import java.util.Objects;

public class Classes implements Serializable {

    private int clsid;
    //使用total变量记录班级的学生总数
    private int total = 0;
    //使用create_stuid来生成学生的id,此变量只增不减
    private int create_stuid = 0;

    public Classes(int clsid) { this.clsid = clsid; }


    //要使用Classes对象作为key,所以重写了Object中的equals方法和hashCode方法.
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Classes classes = (Classes) o;
        return clsid == classes.clsid;//在这里选择clsid作为比较原则
    }

    @Override
    public int hashCode() {
        return Objects.hash(clsid);
    }


    public int getClsid() {
        return clsid;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getCreate_stuid() {
        return create_stuid;
    }

    public void setCreate_stuid(int create_stuid) {
        this.create_stuid = create_stuid;
    }

}
